<html>
    <head>
        <meta name="viewport" content="width=#width#, maximum-scale=10.0" />
        <style>
            html {
                -webkit-text-size-adjust: none;
            }
            body {
                background-color:rgb(230, 230, 230);/*color:rgb(176, 201, 242); */
            }
            td {
                font-size:16px;
            }
            a.btn_big {
                display:inline-block;
                padding-right:4px;
                background:url('#button#') no-repeat 100% 0;
                font-family:'돋움',dotum;
                font-size:12px;
                color:#444;
                line-height:26px;
                word-spacing:-1px;
                text-decoration:none !important;
                white-space:nowrap;
            }
            a.btn_big span,
            a.btn_big strong {
                display:block;
                padding:1px 8px 0 12px;
                background:url('#button#') no-repeat;
            }            #imagebutton {
                background:url(#button#) no-repeat 0-27px;
            }
        </style>
        <script type="text/javascript">
            window.imgtags = '#images#';
            window.first = true;
            function loadFunc() {
                var link = document.getElementById("links");
                var links = link.getElementsByTagName("a");
                for(var i = 0; i < links.length; i++ ) {
                    links[i].innerHTML = '<strong>링크#'+(i+1) + '</strong>';
                    links[i].className = "btn_big";
                }
                var imgs = document.getElementsByTagName("img");
                for( var i = 0; i < imgs.length; i++ ) {
                    imgs[i].style.display = "none";
                    imgs[i].onclick = null;
                    if( i == imgs.length-1 ) {
                       imgs[i].onload = function() {
                            imageOnloadFunc.call(this);
                            location.href = "callback:imageloaded";
                        };
                    }
                    else {
                        imgs[i].onload = function() {
                            imageOnloadFunc.call(this);
                        };
                    }
                }
                var objects = document.getElementsByTagName("*");
                var limitWidth = #width# - 15;
                for( var i = 0; i < objects.length; i++ ) {
                    var limitWidth = #width# - 15;
                    var width = parseInt(objects[i].width);
                    var height = parseInt(objects[i].height);
                    if( width > limitWidth ) {
                        objects[i].height = (height * limitWidth) / width;
                        objects[i].width = limitWidth;
                    }
                }
                if( window.imgtags.length == 0 && imgs.length == 0 ) {
                    document.getElementById('imageButton').parentNode.removeChild(document.getElementById('imageButton'));
                } else if ( #showImage# ) {
                    toggleImage();
                }
            }
            function toggleImage() {
                try {
                    var imgdiv = document.getElementById("images");
                    var imgs = document.getElementsByTagName("img");
                    if( window.first == true ) {
                        window.first = false;
                        imgdiv.innerHTML = window.imgtags;
                        imgs = document.getElementsByTagName("img");
                        for( var i = 0; i < imgs.length; i++ ) {
                            imgs[i].onclick=null;
                            imgs[i].style.display="none";
                            if( i == imgs.length-1 ) {
                                imgs[i].onload = function() {
                                    imageOnloadFunc.call(this);
                                    location.href = "callback:imageloaded";
                                };
                            }
                            else {
                                imgs[i].onload = function() {
                                    imageOnloadFunc.call(this);
                                };
                            }
                        }
                    }
                    for( var i = 0; i < imgs.length; i++ ) {
                        if( imgs[i].style.display == "" ) {
                            imgs[i].style.display="none";
                        }
                        else {
                            imgs[i].style.display="";
                        }
                    }
                    location.href = "callback:imageloaded";
                } catch(e) {
                    alert(e);
                }
            }
            if ( document.addEventListener ) {
                document.addEventListener( "DOMContentLoaded", function(){
                                          document.removeEventListener( "DOMContentLoaded", arguments.callee, false);
                                          loadFunc();
                                          }, false );
            }
            function imageOnloadFunc() {
                var limitWidth = #width# - 15;
                if( this.width > limitWidth ) {
                    this.height = (this.height * limitWidth) / this.width;
                    this.width = limitWidth;
                }
            }
        </script>
    </head>
    <body>
        <span id="links">#links#</span>
        <span id="imageButton"><a href="#" class="btn_big" onclick="toggleImage(); return false;"><strong>이미지 확인/감추기</strong></a></span><br/>
        <div id="images"></div>
        <table id="bodytable">
            <tbody>
                <tr>
                    #content#
                </tr>
            </tbody>
        </table>
    </body>
</html>